Skip to content

loopway finds its project by walking up to the nearest .loopway/ - #509

Closed
mcwhittemore wants to merge 3 commits into
mainfrom
project-walk-up
Closed

mcwhittemore wants to merge 3 commits into
mainfrom
project-walk-up

Conversation

@mcwhittemore

@mcwhittemore mcwhittemore commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #508

loopway finds its project like git finds a repo: it walks up from the current directory to the nearest directory with a .loopway/ folder. No INIT_CWD fallback. --project <dir> skips the search. With no .loopway/ found it exits naming where it looked. The first log line and the TUI header print the resolved .loopway. The root cli script is removed (it read the checkout's own .loopway), and npm link -w @loopway/cli is the documented dev entry point (README, docs/developing.md).

Test locally

  1. npm run build && npm link -w @loopway/cli
  2. In a scratch project with .loopway/dev.md, or a subdirectory of it, run loopway --no-tui: the first line names that .loopway.
  3. cd /tmp && loopway: exits saying no .loopway/ was found above /tmp.
  4. loopway --project <scratch> from anywhere uses that project.
  5. npm test, npm run typecheck, npm run lint, npm run format:check.

Verification: verifications/509.md

🤖 Generated with Claude Code

@mcwhittemore

Copy link
Copy Markdown
Collaborator Author

What happens when it gets to ~/.loopway? Also, does .loopway need to be a sibling of .git?

@mcwhittemore

Copy link
Copy Markdown
Collaborator Author
Good catch on `~/.loopway`: it was a real bug. The folder has the same name, so any directory under `~` with no project of its own resolved to `~` and would have kept state in `~/.loopway/state/`. `findProject` now skips the loopway home (`$LOOPWAY_HOME`, default `~/.loopway`), with a test and a live check in `verifications/509.md`. It does not need to sit beside `.git`: any `.loopway/` folder at or above where you run counts. Pushed.

@github-actions github-actions Bot added the conflicts Conflicts with its base branch; set and cleared by the Label merge conflicts workflow label Nov 11, 2026
@github-actions

Copy link
Copy Markdown

This PR conflicts with its base branch. Rebase onto it, resolve the conflicts, and push.

@github-actions github-actions Bot added conflicts Conflicts with its base branch; set and cleared by the Label merge conflicts workflow and removed conflicts Conflicts with its base branch; set and cleared by the Label merge conflicts workflow labels Nov 11, 2026
@github-actions

Copy link
Copy Markdown

This PR conflicts with its base branch. Rebase onto it, resolve the conflicts, and push.

mcwhittemore and others added 3 commits November 10, 2026 22:41
Drops the INIT_CWD fallback and the root `cli` script, adds --project <dir>,
names the resolved .loopway in the first log line and the TUI header, and
documents `npm link -w @loopway/cli` as the dev entry point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the conflicts Conflicts with its base branch; set and cleared by the Label merge conflicts workflow label Nov 11, 2026
@mcwhittemore

Copy link
Copy Markdown
Collaborator Author
Closing, as Matthew asked on #508 ("past where we are from a robustness POV"). The branch `project-walk-up` stays on the remote in case it is wanted later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm run cli reads the checkout's .loopway, not the directory you ran it from

1 participant